<%
strUsername = "boboju"
strPassword = "998877"

Randomize
Set xmlHttp = Server.CreateObject("MSXML2.ServerXMLHTTP.4.0")
xmlHttp.open "GET", "http://www.77go.cn/authimg?a=" & Rnd, false
xmlHttp.send

Cookie = xmlHttp.getResponseHeader("Set-Cookie")
Cookie = Replace(Cookie, "; path=/", "")
AuthCode = Replace(Cookie, "AI=", "")

xmlHttp.open "POST", "http://www.77go.cn/login.bbscs", false
xmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
xmlHttp.send "username=" & strUsername & "&tourl=indexpage&action=login&passwd=" & strPassword & "&authcode=" & AuthCode
RespnoseBody = xmlHttp.responseText
If Instr(RespnoseBody, "alert") <= 0 Then
	xmlHttp.open "GET", "http://www.77go.cn/in.bbscs", false
	xmlHttp.send "authcode=" & AuthCode
	RespnoseBody = xmlHttp.responseText
	Dim regEx, match, matches ' 建立变量。 
	Set regEx = New RegExp ' 建立规范表达式。
	regEx.Pattern = "src.+jpg_Small"
	'regEx.IgnoreCase = False ' 设置是否区分字母的大小写。 
	'regEx.Global = True ' 设置全程性质。 
	set matches= regEx.Execute(RespnoseBody) ' 执行搜索。
	if Not IsEmpty(matches) then
		strSrc = matches(0).value
		strSrc = Mid(strSrc, 5, len(strSrc) - 10)
		strSrc = "http://www.77go.cn/" & strSrc
		strSrc = "http://www.77go.cn/file/user/75/26713/267131163645905584.jpg?authcode=" & AuthCode
		xmlHttp.open "POST", strSrc, false
		xmlHttp.send 
		i = xmlHttp.readyState
		GetRemoteData = xmlHttp.ResponseBody 
		Set Ads = Server.CreateObject("Adodb.Stream") 
		With Ads 
			.Type = 1 
			.Open 
			.Write GetRemoteData 
			.SaveToFile server.MapPath("a.jpg"),2 
			.Cancel() 
			.Close() 
		End With 
		Set Ads=nothing 
	end if	
End If
%>